package com.gydz.gydzbaseframeworkboot.CsdE.service.impl;

import com.gydz.gydzbaseframeworkboot.Common.utils.FieldConverter;
import com.gydz.gydzbaseframeworkboot.CsdE.dao.EInterfaceCsdMapper;
import com.gydz.gydzbaseframeworkboot.CsdE.domain.EInterfaceCsd;
import com.gydz.gydzbaseframeworkboot.CsdE.service.IEInterfaceCsdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.lang.reflect.Field;
import java.util.List;

@Service
public class EInterfaceCsdServiceImpl implements IEInterfaceCsdService {
    @Autowired
    private EInterfaceCsdMapper eInterfaceCsdMapper;

    /**
     * 查询e_csd列表
     *
     * @param priInterfaceCsd EInterfaceCsd
     * @return EInterfaceCsd
     */
    @Override
    public List<EInterfaceCsd> selectEInterfaceCsdList(EInterfaceCsd priInterfaceCsd)
    {
        //反射遍历查询结果，将字段为-1的值置空
        List<EInterfaceCsd> eInterfaceCsdList = eInterfaceCsdMapper.selectEInterfaceCsdList(priInterfaceCsd);
        FieldConverter.convertMinusOneToNull(eInterfaceCsdList);
        eInterfaceCsdList.forEach(EInterfaceCsd::convertEnums);
        return eInterfaceCsdList;
    }

}
